/**
 * 引用layui自定义模块 --- 弹出层
 * Created by baijian on 2017/6/8.
 */

layui.use('layer', function () {
    var layer = layui.layer;
    $("#add_btn").on("click", function () {
        //iframe层
        layer.open({
            type: 2,
            title: '新增会员信息',
            shadeClose: true,
            shade: 0.8,
            area: ['90%', '700px'],
            maxmin: true, //开启最大化最小化按钮
            content: base + '/vip/customer/add' //iframe的url
        });
    })
    $(".glyphicon-edit").each(function () {
        $(this).on("click", function () {
            var id = $(this).data("id");
            //iframe层
            layer_diolag(id);
        })
    })
    $(".edit_click").each(function () {
        $(this).on("click", function () {
            var id = $(this).data("id");
            //iframe层
            layer_diolag(id);
        })
    })

    function layer_diolag(id){
        layer.open({
            type: 2,
            title: '编辑会员信息',
            shadeClose: true,
            shade: 0.8,
            area: ['90%', '700px'],
            maxmin: true, //开启最大化最小化按钮
            content: base + '/vip/customer/edit/' + id //iframe的url${base}/vip/customer/edit/
        });
    }
});